package com.lct.simpleforecast.mvp.model

import com.lct.simpleforecast.bean.CityBean
import com.lct.simpleforecast.mvp.model.network.IRequest
import com.lct.simpleforecast.mvp.model.network.OkHttp
import com.lct.simpleforecast.mvp.model.network.Url
import okhttp3.Call

/**
 * Author：SkySmile
 * Date：2018/7/12
 * Description：SettingActivity对应的model
 */
class SettingModel {

    /**
     * 根据位置获取城市数据
     *
     * @param location 位置（上海）
     * @param request 回调
     * @return Call对象
     */
    fun getCityData(location: String, request: IRequest<CityBean>): Call? {
        val url = "${Url.cityUrl}?key=${Url.heWeatherKey}&group=cn&number=19&location=$location"
        return OkHttp.doGet(url, request)
    }
}